//
//  GuideMiddleViewController.m
//  BeautifulShoppings
//
//  Created by GivenBmli on 16/9/7.
//  Copyright © 2016年 GivenBmli. All rights reserved.
//

#import "GuideMiddleViewController.h"
#import "TAMacro.h"
@interface GuideMiddleViewController ()
@property (nonatomic ,strong)UIButton * imageButton;
@property (nonatomic ,strong)UIAlertController * alertController;
@property (nonatomic ,strong)UIAlertController * actionSheet;
@end

@implementation GuideMiddleViewController
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor purpleColor];
    UIButton *butt = [UIButton buttonWithType:UIButtonTypeCustom];
    [butt setImage:[UIImage imageNamed:@"返回"] forState:UIControlStateNormal];
    butt.frame  = CGRectMake(0, 0, 50, 50);
    UIBarButtonItem *left= [[UIBarButtonItem alloc]initWithCustomView:butt];
    [butt addTarget:self action:@selector(clickLeft:) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.leftBarButtonItem =left;
    if ([self.str  isEqual: @"1"]) {
        UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH , SCREEN_HEIGHT)];
        image.image = [UIImage imageNamed:@"邀请"];
        [self.view addSubview:image];
    }else if ([self.str isEqual:@"2"]){
        UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH , SCREEN_HEIGHT)];
        image.image = [UIImage imageNamed:@"签到"];
        [self.view addSubview:image];
        self.imageButton = [UIButton buttonWithType:UIButtonTypeCustom];
        self.imageButton.frame = CGRectMake(SCREEN_WIDTH / 2 - SCREEN_WIDTH / 14, SCREEN_HEIGHT / 10 * 8.5, SCREEN_WIDTH / 7, SCREEN_WIDTH / 7);
        [self.view addSubview:self.imageButton];
        [ self.imageButton addTarget:self action:@selector(chickVC:) forControlEvents:UIControlEventTouchUpInside];
    }
}
- (void)chickVC:(UIButton *)sa {
    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"想签到?就不让你签" preferredStyle:UIAlertControllerStyleAlert];
    [self presentViewController:alertController animated:YES completion:nil];
    self.alertController = alertController;
    UIAlertAction *defauleAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:nil];
    [self.alertController addAction:defauleAction];

}
- (void)clickLeft:(UIBarButtonItem*)qwe {
    [self.navigationController popViewControllerAnimated:YES];
}
@end
